<!DOCTYPE html>
<html data-ng-controller="mainCtrl">

<head lang="zh">
    <meta charset="UTF-8">
    ${require('mypublic/inc/head.html')}
</head>

<body>
    ${require('mypublic/inc/seajs.html')}
    ${require('mypublic/inc/top.html')}
    ${require('@yunke/core/html/server_time.html')}
    <div class="layout">
        <!-- 容器 [[-->
        <div class="container">
            <div class="wrap clearfix">
                <div class="pt10">
                    ${require('mypublic/inc/left_side.html')}
                </div>
                <div class="content">
                    <div class="section-table mt20">
                        <div class="table-header lh30 pb5 clearfix" ng-if="userAuthList.indexOf('0641') !== -1">
                            <div class="fr btn-group">
                                <button class="btn" id="save">保存</button>
                                <button class="btn" id="save_preview">保存并预览</button>
                                <button class="btn" id="save_create">保存并新建</button>
                                <button class="btn" id="save_close">保存并关闭</button>
                                <button ng-show="data.a_id" class="btn btn-yellow" id="save_copy">保存并复制</button>
                                <button class="btn" id="no_save">取消</button>
                            </div>
                        </div>
                        <div class="mt10" ng-cloak>
                            <div class="fl">
                                <div class="section">
                                    <div class="section-span"><span style="color:#ff0000;"> </span>目录：</div>
                                    <div>
                                        <select id="dir_id" class="form-control form-w" name="dir_id" ng-model="selectedItem" ng-change="catlogChange(e)">
                                            <option ng-repeat="item in data.dirs" value="{{item.key}}" ng-selected="{{data.dir_id===item.key}}">{{item.value}}</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="section">
                                    <div class="section-span"><span style="color:#ff0000;">* </span>标题：</div>
                                    <div>
                                        <input type="text" ng-model="data.title" name="title" id="title" class="form-control form-w">
                                    </div>
                                </div>
                                <input type="hidden" id="showYdxs" value={{data.showYdxs}}>
                                <div ng-show="data.showYdxs">
                                    <div class="section">
                                        <div class="section-span"><span style="color:#ff0000;"> </span>摘要：</div>
                                        <div class="clearfix">
                                            <div class="radio fl " style="margin-right:50px;margin-top:4px">
                                                <input type="radio" ng-model="data.abstract_mode" required value='1' id="rbt_dev" name="abstractMode" checked="checked">
                                                <label for="rbt_dev">文本</label>
                                            </div>
                                            <div class="radio fl" style="margin-top:4px" ng-hide="data.notShowPreShow">
                                                <input type="radio" ng-model="data.abstract_mode" required value='2' id="rbt_agent" ng-change="attractModeToImg()" name="abstractMode">
                                                <label for="rbt_agent">图片</label>
                                            </div>
                                            <input type="hidden" id="abstractMode" value={{data.abstract_mode}}>
                                            <div class="fl preShowWrap" ng-hide="data.notShowPreShow">
                                                <a id="preShow">预览</a>
                                            </div>
                                        </div>
                                        <div class="col-sm-10 ml100" ng-show="(data.abstract_mode == 1)">
                                            <textarea name="remark" id="abstract" class="form-control" rows="5" cols="10" ng-model="data.abstract" ng-KeyDown="limitText()"
                                                ng-KeyUp="limitText()"></textarea>
                                            <span>剩余可输入字数：{{abstractCountDown}}</span>
                                        </div>
                                    </div>
                                </div>
                                <div class="section" ng-show="(!data.showYdxs || data.abstract_mode == 2)">
                                    <div class="section-span"><span style="color:#ff0000;"> </span><span ng-show="(!data.showYdxs)">封面图片：</span></div>
                                    <div id="image_load" class="content table-cell" style="margin-left:{{data.showYdxs ? '100px' : 0}}">
                                        <div id="upload_button">
                                            <div>+</div>
                                            <p>上传图片</p>
                                        </div>
                                    </div>
                                    <div class="image-upload-container" style="margin-left:{{data.showYdxs ? '100px' : 0}}">
                                        <div id="preview_container" style="position: relative;"></div>
                                        <div class="controllbar table" style="position: absolute;">
                                            <div class="upload table-cell" style="">重新上传</div>
                                            <div class="cancel table-cell" style="">删除</div>
                                        </div>
                                    </div>
                                    <div style="display: none;">
                                        <form action="#" enctype="multipart/form-data" method="post" role="image-upload-file-form">
                                            <input name="file" role="image-upload-file-input" accept="image/*" style="display:none;" type="file">
                                        </form>
                                    </div>
                                    <input type="hidden" name="image_url" id="image_url" ng-model="data.image_url" value={{data.image_url}}>
                                </div>
                                <p class="section" ng-show="(data.showYdxs && data.abstract_mode == 2)"><span style="margin-left:100px;">建议宽*高：600*1066 （单位：px）</span></p>
                                <div class="section clearfix" ng-show="data.showYdxs">
                                    <div class="section-span"><span style="color:#ff0000;">* </span>显示规则：</div>
                                    <div class="clearfix">
                                        <div class="checkbox fl" style="margin-right:50px;margin-top:4px">
                                            <input type="checkbox" name="firstVisit" id="firstVisitInput" ng-model="data.first_visit_show" ng-true-value='"1"' ng-false-value='"0"'>
                                            <label for="firstVisitInput">首次进入提醒</label>
                                            <input type="hidden" id="firstVisit" ng-value="data.first_visit_show">
                                        </div>
                                        <div class="checkbox fl" style="margin-right:50px;margin-top:4px">
                                            <input type="checkbox" name="periodVisitShow" id="periodVisitShowInput" ng-model="data.period_visit_show" ng-true-value='"1"'
                                                ng-false-value='"0"'>
                                            <label for="periodVisitShowInput">时间段内提醒</label>
                                            <input type="hidden" id="periodVisitShow" ng-value="data.period_visit_show">
                                        </div>
                                    </div>
                                    <p class="tab-indent" ng-show="(data.period_visit_show == 1)">
                                        <span class="fl mr10 lh30">G0：</span>
                                        <input style="width:161px" type="text" class="fl input-text  ml3 input-date" ng-model="data.period_start_time" ui-date id='start_date'
                                            max-date="#F{$dp.$D(\'end_date'\)}" format="yyyy-MM-dd H:mm">
                                        <span class="fl ml3">-</span>
                                        <input style="width:161px" type="text" class="fl input-text  ml3 input-date" min-date="#F{$dp.$D(\'start_date'\)}" ng-model="data.period_end_time"
                                            id="end_date" ui-date format="yyyy-MM-dd H:mm">
                                    </p>
                                    <p class="tab-indent" ng-show="(data.period_visit_show == 1)">
                                        <span class="fl mr10 lh30">G2：</span>
                                        <input style="width:161px" type="text" class="fl input-text  ml3 input-date" ng-model="data.g2_period_start_time" ui-date id='g2_start_date'
                                               max-date="#F{$dp.$D(\'g2_end_date'\)}" format="yyyy-MM-dd H:mm">
                                        <span class="fl ml3">-</span>
                                        <input style="width:161px" type="text" class="fl input-text  ml3 input-date" min-date="#F{$dp.$D(\'g2_start_date'\)}" ng-model="data.g2_period_end_time"
                                               id="g2_end_date" ui-date format="yyyy-MM-dd H:mm">
                                    </p>
                                    <div class="tab-indent">
                                        <span class="fl mr10 lh30">租户：</span>
                                        <div class="select w328 fl"
                                             ui-combobox
                                             data="tenants"
                                             only-show-all="true"
                                             show-filter="true"
                                             ng-model="data.tenants"
                                             multiple
                                             text-field="text"
                                             value-field="value">
                                    </div>
                                </div>
                                <div class="section">
                                    <div class="section-span"><span style="color:#ff0000;"> </span>作者：</div>
                                    <div>
                                        <input type="text" ng-model="data.author" name="author" id="author" class="form-control form-w">
                                    </div>
                                </div>
                                <div class="section">
                                    <div class="section-span"><span style="color:#ff0000;"> </span>标签：</div>
                                    <div>
                                        <input type="text" ng-model="data.tag" name="tag" id="tag" class="form-control form-w"><span>   多个标签时，请以中文逗号“，”隔开，如“视频，培训，移动销售”</span>
                                    </div>
                                </div>
                                <div class="section">
                                    <div class="section-span">原文链接：</div>
                                    <div>
                                        <input type="text" ng-model="data.link_url" name="link_url" id="link_url" class="form-control form-w">
                                    </div>
                                </div>
                                <div class="section">
                                    <div class="section-span">显示时间：</div>
                                    <div>
                                        <input type="number" maxlength="20" style="width:50px" ng-model="data.close_time" name="close_time" id="close_time" class="form-control form-w"><span> 秒(为空则用户点击关闭)</span>
                                    </div>
                                </div>
                                <input type="hidden" name="a_id" id="a_id" ng-value="data.a_id">
                            </div>
                            <div  class="qrcode-wrap" style="display:none">
                                <div tabindex="-1" class="ui-popup ui-popup-modal ui-popup-show ui-popup-focus"
                                    role="alertdialog">
                                    <div i="dialog" class="ui-dialog ui-dialog-effective">
                                        <div class="ui-dialog-arrow-a"></div>
                                        <div class="ui-dialog-arrow-b"></div>
                                        <table class="ui-dialog-grid">
                                            <tbody>
                                                <tr>
                                                    <td i="header" class="ui-dialog-header"><button i="close" class="ui-dialog-close" title="取消">×</button>
                                                        <div i="title" class="ui-dialog-title" >扫描二维码预览效果</div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td i="body" class="ui-dialog-body">
                                                        <div i="content" class="ui-dialog-content"  >
                                                            <div id="qrcode"></div>
                                                            </div>
                                                    </td>
                                                </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>


                            </div>
                            <div class="edit_wrapper" style="float: left;">
                                <div style="width: 80%;">
                                    <script type="text/plain" id="meEditor"></script>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 容器 ]]-->
    </div>
</body>
${require('@yunke/core/public_menu/footer.html')}
<script type="text/javascript" src="./index.js"></script>

</html>
